//app.js

App({
  onLaunch:function(){
    wx.getSystemInfo({
      success: (res)=>{
        this.globalData.statusBarHeight = res.statusBarHeight
        this.globalData.titleBarHeight = wx.getMenuButtonBoundingClientRect().bottom + wx.getMenuButtonBoundingClientRect().top - (res.statusBarHeight * 2)
      },
      fail: ()=>{
        this.globalData.statusBarHeight = 0
        this.globalData.titleBarHeight = 0
      },
      complete: ()=>{}
    })
  },
  globalData: {
    userInfo: null
  }
// promisify all wx's api
    
})